/**
 * 关系图配置文件
 */

// 默认配置
export const DEFAULT_CONFIG = {
  nodeSize: 40,
  nodeColor: '#8B5CF6',
  edgeWidth: 2,
  backgroundColor: '#e1eaff',
  layoutMode: 'force',
  zoomLevel: 0.8,
  maxRetries: 3
};

// 颜色配置
export const COLOR_PALETTE = [
  '#FFFFFF','#000000','#FF5722','#FF9800','#FFEB3B','#4ADE80','#22D3EE',
  '#2563EB','#A21CAF','#FCA5A5','#F59E42','#FDE68A','#6EE7B7','#5EEAD4'
];

// 线条粗细选项
export const LINE_WIDTH_OPTIONS = [
  { label: '细', value: 1 },
  { label: '略细', value: 2 },
  { label: '中等', value: 3 },
  { label: '略粗', value: 4 },
  { label: '粗', value: 6 }
];

// 默认筛选选项
export const DEFAULT_FILTER_OPTIONS = [
  { 
    key: 'company', 
    label: '企业', 
    type: 'select', 
    options: [] 
  },
  { 
    key: 'region', 
    label: '地区', 
    type: 'select', 
    options: [] 
  },
  { 
    key: 'gender', 
    label: '性别', 
    type: 'select', 
    options: [ 
      { label: '男', value: 'male' }, 
      { label: '女', value: 'female' } 
    ] 
  },
  { 
    key: 'age', 
    label: '年龄', 
    type: 'range', 
    options: [] 
  }
];

// 节点详情弹窗字段配置
export const NODE_DETAIL_FIELDS = [
  { key: 'company', label: '企业' },
  { key: 'position', label: '职位' },
  { key: 'job', label: '职位' },
  { key: 'nickname', label: '昵称' },
  { key: 'phone', label: '电话' },
  { key: 'email', label: '邮箱' }
];

// 图表配置
export const CHART_CONFIG = {
  animationDurationUpdate: 1500,
  animationEasingUpdate: 'quinticInOut',
  force: {
    repulsion: 800,
    edgeLength: 120,
    gravity: 0.3,
    friction: 0.4,
    layoutAnimation: true
  },
  edgeSymbol: ['none', 'arrow'],
  edgeSymbolSize: [0, 10],
  edgeLabel: {
    fontSize: 12,
    color: '#666'
  },
  lineStyle: {
    color: '#999',
    opacity: 0.8,
    curveness: 0.2
  },
  emphasis: {
    focus: 'adjacency',
    label: {
      position: 'right',
      show: true
    }
  },
  categories: [
    { name: 'company', symbol: 'rect' },
    { name: 'person', symbol: 'circle' }
  ]
};

// 节点样式配置
export const NODE_STYLE = {
  itemStyle: {
    borderWidth: 0,
    shadowBlur: 6,
    shadowColor: 'rgba(0, 0, 0, 0.15)'
  },
  label: {
    normal: {
      fontSize: 12,
      color: '#fff',
      fontWeight: 'bold'
    },
    avatar: {
      position: 'bottom',
      backgroundColor: '#4285f4',
      padding: [3, 8],
      borderRadius: 12,
      shadowBlur: 4,
      shadowColor: 'rgba(66, 133, 244, 0.3)'
    }
  }
};

// 公司节点默认配置
export const COMPANY_NODE_CONFIG = {
  size: 50,
  color: '#10B981',
  category: 0
};

// 个人节点默认配置
export const PERSON_NODE_CONFIG = {
  size: 40,
  color: '#8B5CF6',
  category: 1
}; 